package com.kelp.codetoolkit.enums

/**
 * @author: liuyuebai
 * @date: 2025/1/14 08:08
 * @description:
 */
enum class RequestMethodEnum(val methodName: String,val springMethodName: String,val methodPackageName: String) {

    GET("GET","@GetMapping",methodPackageName = "org.springframework.web.bind.annotation.GET"),
    POST("POST"," @PostMapping",methodPackageName = "org.springframework.web.bind.annotation.POST"),
    PUT("PUT"," @PutMapping",methodPackageName = "org.springframework.web.bind.annotation.PUT"),
    DELETE("DELETE"," @DeleteMapping",methodPackageName = "org.springframework.web.bind.annotation.DELETE"),

    ;

    companion object{
        fun get(methodName: String): RequestMethodEnum {
            return RequestMethodEnum.values().find { it.methodName == methodName }?:POST
        }
    }
}